import { defineStore } from 'pinia';

export const useLoginStore = defineStore('login', {
	state: ()=>{
		return {
			userInfo: {},
			token: '',
			openId: {}
		}
	},
	getters: {
		
	},
	//  动作支持异步
	actions: {
		setUserInfo(res){
			this.userInfo = res;
		},
		setOpenId(openIdInfo){
			this.openId = openIdInfo;
		},
		clearAll(){
			this.userInfo = {};
			this.token = '';
			this.openId = {}
		}
	}
});